#!/usr/bin/env bash
# $LastChangedDate: 2010-05-25 21:26:05 -0400 (Tue, 25 May 2010) $
# LEGAL: COPYRIGHT (C) 2010 JIM E. BROOKS WWW.PALOMINO3D.ORG

# Compile tests if necessary.
if [ ! -d out ]; then
    make DEBUG=1 -C ../..
    make DEBUG=1
fi

# Run each test.  For each executable in out/
for TEST in out/*
do
    if [ -x $TEST ] && [ ! -d $TEST ]; then
        echo "---  running test $TEST ---"
        if ( ! $TEST ); then
        echo "---  test $TEST FAILED! ---"
            exit 1
        fi
    fi
done

echo "*************************"
echo "* All tests passed (ok) *"
echo "*************************"
exit 0
